'''
Author: sky heart3214@163.com
Date: 2022-07-15 07:03:43
LastEditors: sky heart3214@163.com
LastEditTime: 2022-07-21 21:12:55
FilePath: \机器学习-微积分\ch2_4倒数的极限自变量向左趋近于0.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
# -*- coding: utf-8 -*-
"""
file:ch2_4倒数的极限自变量向左趋近于0
author: Fuwen
time: 2022/7/15 7:03
software:PyCharm
"""
# x向左趋近于0+， y的极限 趋近于无穷大， y=1/x ， 发散
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(1, 0.001, 1001)
y = [1/i for i in x]

plt.axis([0,1, 0, 1001])
plt.plot(x, y, '-x')
plt.xlabel('n')
plt.ylabel('y')
plt.grid()
plt.show()